package com.zr.daoimpl;

import java.util.Iterator;
import java.util.List;

import org.hibernate.Query;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;

import com.zr.dao.DistributionscopeDaoLPN;
import com.zr.model.Distributionscope;
import com.zr.vo.Dp_DsVO;
import com.zr.vo.Drp_dpVO;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Repository("DistributionscopeDaoLPN")
public class DistributionscopeDaoImplLPN extends BaseDaOImpl implements DistributionscopeDaoLPN{

	@Override
	public List findDS(int dpId) {
		
		String sql = "select ds.dsId,ds.dsName,ds.dsDate,ds.dsRemarks,ds.dpId from distributionscope ds where ds.dpId=:dpId";
		Query query = this.getCurrentSession().createSQLQuery(sql);
		query.setInteger("dpId", dpId);
		List<Dp_DsVO>  obj = query.setResultTransformer(Transformers.aliasToBean(Dp_DsVO.class)).list();							 				
		return obj;
	}

}
